<?php

class Control_Menu_Sitetop extends QUI_Control_Abstract
{
    function render()
    {
    	$ctx = QContext::instance();
    	if($ctx->controller_name == 'product' && $ctx->action == 'list'){
    		$this->select_product = ' class="selected"';
    	}elseif($ctx->action == 'aboutus'){
    		$this->select_about_us = ' class="selected"';
    	}elseif($ctx->controller_name == 'default' && $ctx->action == 'index'){
    		$this->select_home = ' class="selected"';
    	}elseif($ctx->action == 'contactus'){
    		$this->select_contact_us = ' class="selected"';
    	}elseif($ctx->action == 'onlineshop'){
    		$this->select_online_shop = ' class="selected"';
    	}
    	
    	return '
<ul id="'.$this->id().'">
	<li><a href="'.url('default/index').'"'.$this->select_home.'>home</a></li>
	<li><a href="'.url('product/list', array('category_id' => Category::rootNodeId())).'"'.$this->select_product.'>products</a></li>
	<li><a href="'.url('article/about_us').'"'.$this->select_about_us.' rel="nofollow">about us</a></li>
	<li><a href="'.url('article/contact_us').'"'.$this->select_contact_us.' rel="nofollow">contact us</a></li>
	<li><a href="'.url('article/online_shop').'"'.$this->select_online_shop.' rel="nofollow">online shop</a></li>
	<li><form action="'.url('product/list').'">
		<input id="search" name="search" value="'.QContext::instance()->search.'" />
		<input class="btn" type="submit" value="search" />
	</form></li>
</ul>';
    }
}

